package com.hmdp.controller;


import com.hmdp.dto.Result;
import com.hmdp.service.IFollowService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.security.PublicKey;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 虎哥
 * @since 2021-12-22
 */
@RestController
@RequestMapping("/follow")
public class FollowController {

    @Resource
    IFollowService followService;

    @PutMapping("/{id}/{type}")
    public Result follow(@PathVariable("id") Long followId, @PathVariable("type") Boolean type){
        return followService.follow(followId,type);
    }

    @GetMapping("/or/not/{id}")
    public Result follow(@PathVariable("id") Long followId){
        return followService.isFollowed(followId);
    }

    @GetMapping("/common/{id}")
    public Result commonSub(@PathVariable("id") Long blogerId){
        return followService.commonSub(blogerId);
    }

}
